package com.young.springdemo.service.jpa;

import com.young.springdemo.config.red.RedPerson;
import com.young.springdemo.jpa.entity.TeacherEntity;
import com.young.springdemo.jpa.repository.TeacherRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: springdemo
 * @description 教师查询服务类
 * @author: Young
 * @create: 2020-05-31 15:24
 **/
@Service
@Slf4j
public class TeacherService {

    @Autowired
    private TeacherRepository teacherRepository;

    //红名单人员验证的注解
    @RedPerson
    public List<TeacherEntity> findAll(String userName) {
        log.debug("开始查询");
        return teacherRepository.findAll();
    }
}
